﻿'use strict';
(function () {
    // 注意JS的绑定顺序，第一组绑定的文件可以用angular.module('MyControllers', []);，后续的文件只能用angular.module('MyControllers')
    var service = angular.module('MyServices');

    service.factory('examMonitorService', ['$http', function (http) {
        var methods = {
            // 考试监控
            examMonitorSrv: {
                getList: function (type) {
                    return http.post('/ExamMonitor/GetList', { planType: type ,account : commonFun.getCookie('account') });
                }
            },

            // 查看明细服务
            detailSrv: {
                getSceneList: function (planId, roomId, subjectId) {
                    return http.post('/ExamPlan/GetSceneList/', { planId: planId, roomId: roomId, subjectId: subjectId ,account : commonFun.getCookie('account')});
                },
                getRoomList: function (planId, sceneId, subjectId) {
                    return http.post('/ExamPlan/GetRoomList/', { planId: planId, sceneId: sceneId, subjectId: subjectId ,account : commonFun.getCookie('account')});
                },
                getSubjectList: function (planId, sceneId, roomId) {
                    return http.post('/ExamPlan/GetSubjectList/', { planId: planId, sceneId: sceneId, roomId: roomId });
                },
                getExamcaseList: function (anImport, planId, roomId, currentPage, pageSize, statusId, subjectId, sceneId, parameter) {
                    return http.post('/ExamMonitor/GetExamcaseList/', {planId: planId, roomId: roomId, currentPage: currentPage, pageSize: pageSize, statusId: statusId, subjectId: subjectId, sceneId: sceneId, parameter: parameter ,anImport: anImport ,account : commonFun.getCookie('account')});
                },
                getIsRoomDelayed: function (planId, sceneId, roomId) {
                    return http.post('/ExamMonitor/GetIsRoomDelayed/', { planId: planId, sceneId: sceneId, roomId: roomId });
                },
                extendedAllExam: function (planId, sceneId, roomId, extendedTime, reason) {
                    return http.post('/ExamMonitor/ExtendedAllExam/', { planId: planId, sceneId: sceneId, roomId: roomId, extendedTime: extendedTime, reason: reason });
                }
            },

            // 操作服务
            operSrv: {
                //extendedAllExam: function (planId, sceneId, roomId, extendedTime, reason) {
                //    return http.post('Manager/ExamMonitor/ExtendedAllExam/', { planId: planId, sceneId: sceneId, roomId: roomId, extendedTime: extendedTime, reason: reason });
                //},
                extendedExamInfo: function (arrangeId, extendedTime, reason, examCardNo) {
                    return http.post('/ExamMonitor/ExtendedExamInfo/', { arrangeId: arrangeId, extendedTime: extendedTime, reason: reason, examCardNo: examCardNo });
                },
                mandatoryPaper: function (info) {
                    return http.post('/ExamMonitor/MandatoryPaper/', { arrangeId: info.examineeArrangeID, examCardNo: info.examCardNo });
                },
                getStudentInfo: function (planId, examineeId ,subjectId) {
                    return http.post('/ExamMonitor/GetStudentInfo/', { planId: planId, examineeId: examineeId,subjectId: subjectId  ,account : commonFun.getCookie('account')});
                },
                getDeregulationList: function () {
                    return http.post('/ExamMonitor/GetDeregulationList/');
                },
                signDeregulation: function (arrangeId, deregulationId) {
                    return http.post('/ExamMonitor/SignDeregulation/', { arrangeId: arrangeId, deregulationId: deregulationId });
                },
                pushMessageToClient: function (info) {
                    return http.post('/Photo/pushMessageToClient', { ExamCardNO: info.examCardNo, SubjectID: info.examSubjectID });
                },
                findPhotoList: function (info) {
                    return http.post('/Photo/findPhotoList', { examineeArrangeID: info.examineeArrangeID });
                }
            }
        };
        return methods;
    }]);
})();